{% extends "admin/base.html" %}
{% load i18n %}

{% block content %}
<form action="{{ form.action }}" method="post">{% csrf_token %}
    <input onClick="history.back()" type="button" value="{% trans 'Back' %}" />
    <input type="submit" name="2select" value="{% trans 'Change selection' %}" />
    <input type="submit" name="2incoming" value="{% trans 'Incoming (same selection)' %}" />
    <input type="submit" name="2outgoing" value="{% trans 'Outgoing (same selection)' %}" />
    {% include "bots/paginator.html" %}

    <table id="botstable">
        {% for hidden in form.hidden_fields %}
            {{ hidden }}
        {% endfor %}
        <thead>
            <tr>
                <th></th>
                <th><button class="botsheader" type="submit" name="order" value="status" />{% trans 'State' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="idroute" />{% trans 'Route' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="ts" />{% trans 'Date/time' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="fromchannel" />{% trans 'FromChannel' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="tochannel" />{% trans 'ToChannel' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="filename" />{% trans 'Process' %}</button></th>
                <th><button class="botsheader" type="submit" name="order" value="errortext" />{% trans 'Error' %}</button></th>
            </tr>
        </thead>
        <tbody>
        {% for row in queryset.object_list %}
            <tr class="{% cycle 'row1' 'row2' %}">
                <td>
                    <div class="dropdown"><img class="action" src="/media/images/star.png" />
                </td>
                <td>{{row.get_statust_display}}</td>
                <td>{{row.idroute}}</td>
                <td class="nowrap">{{row.ts|date:"Y-m-d H:i:s"}}</td>
                <td>{{row.fromchannel}}</td>
                <td>{{row.tochannel}}</td>
                <td>{{row.filename}}</td>
                <td style="white-space: pre;">{{row.errortext}}</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
</form>
{% endblock %}

